<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>第40个CSS页面</title>
    <style>
        #p1 {
            border: solid red;
        }
    </style>

    <script>
        function changeBorder() {
            document.getElementById("p1").style.borderStyle = "dashed";
        }
    </script>
</head>
<body>

<h4>更改边框</h4>

<input type="button" onclick="changeBorder()" value="更改边框" />

<p id="p1">This is a paragraph</p>

</body>
</html>